import {Injectable} from '@angular/core';
import {HttpClient, HttpParams} from '@angular/common/http';
import {UrlService} from '../common/service/url.service';
import {Observable} from 'rxjs';
import {ApiRes} from '../common/model/response';
import {RegionPolicyCondition} from '../content/model/region-policy-condition';

@Injectable({
  providedIn: 'root'
})
export class NewPolicyListService {

  constructor(private http: HttpClient,
              private urlService: UrlService) {
  }

  getRegionPolicyList(condition: RegionPolicyCondition): Observable<ApiRes> {
    const url = this.urlService.getWebUrl('/policySearch/getPolicyByRegion');
    // @ts-ignore
    return this.http.get<ApiRes>(url, {params: condition});

  }
}
